Temperature and Salinity Workup from raw data:

  1. Compare datalogger data to each other and to YSI sonde data
  2. Present some background summaries and visualizations comparing instruments
  3. Choose datasets best representative of station hydrography, default to RBR
  4. Flag “invalid” data via algorithm based on freezing line
  5. Calibrate EWLD1 and KALD1 (StarOddi) using YSI data
  6. Show some comparison plots b/n calibrated and uncalibrated data
  7. Manually add “Qustionable measurement” flags to questionable conductivity/salinity data and EELD1temerature data form when it was in mud
  8. Write derived (calibrated, QA/QCd) dataset

CTD-QAQC.Rmd is a cleaned-up version that just returns derived datasets and final plots

Import CTD data

First few rows:

## # A tibble: 6 x 12
##   Station DT                  Conductivity Temperature Pressure
##   <chr>   <dttm>                     <dbl>       <dbl>    <dbl>
## 1 EWLD2   2018-08-11 17:00:00         29.2        5.46     13.6
## 2 EWLD2   2018-08-11 18:00:00         29.2        5.47     13.5
## 3 EWLD2   2018-08-11 19:00:00         29.2        5.47     13.5
## 4 EWLD2   2018-08-11 20:00:00         29.2        5.46     13.5
## 5 EWLD2   2018-08-11 21:00:00         29.2        5.44     13.5
## 6 EWLD2   2018-08-11 22:00:00         29.1        5.42     13.5
## # ... with 7 more variables: `Sea pressure` <dbl>, Depth <dbl>,
## #   Salinity <dbl>, `Speed of sound` <dbl>, `Specific conductivity` <dbl>,
## #   `Density anomaly` <dbl>, Instrument <chr>
## # A tibble: 6 x 9
##   Station Date  Time  Temp_C   Sal Cond_mspercm SoundVel_mpers
##   <chr>   <chr> <tim>  <dbl> <dbl>        <dbl>          <dbl>
## 1 KALD1   07.0~ 16:00   5.51  32.8         32            1470.
## 2 KALD1   07.0~ 17:00   5.22  33.4         32.3          1469.
## 3 KALD1   07.0~ 18:00   5.15  32.7         31.6          1468.
## 4 KALD1   07.0~ 19:00   5     24.5         24.2          1457.
## 5 KALD1   07.0~ 20:00   4.93  17.6         17.8          1448.
## 6 KALD1   07.0~ 21:00   4.74  16.8         17.0          1446.
## # ... with 2 more variables: DT <dttm>, Instrument <chr>
## # A tibble: 6 x 5
##   FileName          `ISO 8601 Time`     `Temperature (C~ Station Instrument
##   <chr>             <dttm>                         <dbl> <chr>   <chr>     
## 1 ./data/1805214_1~ 2018-08-07 17:00:00             5.61 KALD1   TCM       
## 2 ./data/1805214_1~ 2018-08-07 18:00:00             5.42 KALD1   TCM       
## 3 ./data/1805214_1~ 2018-08-07 19:00:00             5.28 KALD1   TCM       
## 4 ./data/1805214_1~ 2018-08-07 20:00:00             5.05 KALD1   TCM       
## 5 ./data/1805214_1~ 2018-08-07 21:00:00             5.03 KALD1   TCM       
## 6 ./data/1805214_1~ 2018-08-07 22:00:00             5.08 KALD1   TCM

Import YSI data

First few rows:

## # A tibble: 6 x 5
##   Station DT                  Salinity Temperature Conductivity
##   <chr>   <dttm>                 <dbl>       <dbl>        <dbl>
## 1 EELD1   2019-04-16 12:00:00     35.3        -1.8        27.8 
## 2 EELD1   2019-07-31 20:00:00     24.6         9.1        26.9 
## 3 EELD2   2019-07-31 18:00:00     25.9         7.7        27.3 
## 4 EWLD1   2018-08-11 18:00:00     27.3         6.8        43.0 
## 5 EWLD1   2019-04-13 19:00:00     34.6        -2          27.2 
## 6 EWLD1   2019-06-23 18:00:00     10.5        -0.3         9.59

Compare instrument types (color points) to YSI data (black points)

EWLD1 and KALD1 could use calibration

in April in Jago (JAL), high amounts of stratification meant that YSI may not have hit correct depth and cond/sal reading may be off

Difference in readings between instruments

Calibrate EWLD1 and KALD1 using YSI data

T vs S to check for erroneous data via freezing line

What to flag (“anom” data is below TS line givin instrument precision)

## [1] "SO error: T=0.1, Cond=1.5 mS/cm, RBR error: T=0.002, Cond=0.01 mS/cm"

Choose datasets to use in final table

color=StarOddi, black=RBR

use KALD1 calibrated for Temp and Cond, EWLD1 calibrated for Cond

Next step = Flagging data

Values below freezing line (with error) are flagged “INV” for Invalid

Values that are outliers, or appear to be instrument malfunction (as determined by a trained human), or are from when instrument was in mud (EELD1 RBR pulled up coated in mud, attached to negatively buoyant SeaFET) are flagged “QM” for Questionable Measurement

Finalize tables and display data